package com.wechart.util.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import com.wechart.util.thread.AccessTokenThread;
import com.wechart.util.thread.JsApiTicketThread;

public class InitAccessTokenServlet extends HttpServlet {
	 public void init() throws ServletException {  
	        // 获取web.xml中配置的参数  
	        String WX_APPID = getInitParameter("appid");  
	        String WX_APPSECRET = getInitParameter("appsecret");  
	        AccessTokenThread.appid = WX_APPID;  
	        AccessTokenThread.appsecret = WX_APPSECRET;  
	  
	        if ("".equals(AccessTokenThread.appid) || "".equals(AccessTokenThread.appsecret)) {  
	            System.out.println("appid和appsecret未给出");  
	        } else {  
	            new Thread(new AccessTokenThread()).start();  
	            new Thread(new JsApiTicketThread()).start();  
	        }  
	    }  
}
